package com.zhiche.lisa.bms.service.price.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zhiche.lisa.bms.dao.mapper.price.PriceIncomeLogMapper;
import com.zhiche.lisa.bms.dao.model.price.PriceIncomeLog;
import com.zhiche.lisa.bms.service.price.PriceIncomeLogService;
import com.zhiche.lisa.core.supports.BaseException;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

/**
 * <p>
 * 回写结算价格OTM日志 服务实现类
 * </p>
 *
 * @author liuanshun
 * @since 2018-09-13
 */
@Service
public class PriceIncomeLogServiceImpl extends ServiceImpl<PriceIncomeLogMapper, PriceIncomeLog> implements PriceIncomeLogService {
    @Override
    public void insertPriceIncomeLog(PriceIncomeLog priceIncomeLog) {
        if (ObjectUtils.isEmpty(priceIncomeLog)) throw new BaseException("传入日志信息为空，日志记录失败！");
        boolean result = this.insert(priceIncomeLog);
        if (!result) throw new BaseException("记录OTM的调用日志，失败！");
    }
}
